<template>
  <div class="cous">
    <input type="text" v-model="name" />
    <ChidA :myname="name" @changeMyname="changeMyname"></ChidA>
  </div>
</template>

<script setup>
import { ref } from "vue";
import ChidA from '../components/ChidA';

const name = ref("前端老兵");

// 注意参数名不要和 响应式数据属性名 冲突
const changeMyname = (val)=> {
  name.value = val
}

</script>

<style>

</style>